package carrier.client;

import com.example.entity.User;
import com.example.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "user-service", fallback = UserFallbackClient.class)
public interface UserClient {
    @GetMapping("/selectById")  // 根据id获取用户
    User selectById(@RequestParam(required = false,name = "id") Long id);

    @PostMapping("/signupDriver")
    User registerDriver(@RequestBody User signUp);

    @GetMapping("/getDriverList")
    List<User> selectDriver(@RequestParam(required = false,name = "i")int i,
                            @RequestParam(required = false,name = "id")Long id);

}
